from flask import Flask, jsonify, abort, request
from router.books.books import books
from middleware.check import Check


# 路由入口文件

def router(app):
    # 全局接口访问权限中间件，用于接口访问权限鉴权
    @app.before_request
    def checkAppidAndAppSecret():
        res = Check.checkAppidAndAppSecret()
        if res:
            return jsonify(res)

    # books类路由接口
    app.register_blueprint(books, url_prefix="/api/v1/books")

    # 其他路由类....
